<%
' $Id: Controller.asp 7 2008-06-02 16:29:05Z vipxjw $

class class_Controller

	private controller_
	private controllerName_, actionName_
	private path_
	
	public property let Path(value)
		path_ = value
	end property
	
	public property get ControllerName()
		ControllerName = controllerName_
	end property
	
	public property get ActionName()
		ActionName = actionName_
	end property
	
	public property get Controller()
		set Controller = controller_
	end property

	public function Create(controllerName)
		if controllerName = empty or controllerName = "" then
			controllerName = "Home"
		end if
		controllerName_ = controllerName
		include path_ & "controllers\" & controllerName & ".asp"
		set controller_ = eval("new " & controllerName & "Controller")
	end function

	public function DoAction(action)
		if action = empty or action = "" then
			action = "Index"
		end if
		actionName_ = action
		execute("controller_." & action & "()")
	end function 

end class

%>